<?php

/**
 * Client filter form base class.
 *
 * @package    Jobeet
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseClientFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nom'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prenom'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'mail'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'login'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'motdepasse'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'adresse'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'codepostal'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tel'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'telportable'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'possesionconsole' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'nom'              => new sfValidatorPass(array('required' => false)),
      'prenom'           => new sfValidatorPass(array('required' => false)),
      'mail'             => new sfValidatorPass(array('required' => false)),
      'login'            => new sfValidatorPass(array('required' => false)),
      'motdepasse'       => new sfValidatorPass(array('required' => false)),
      'adresse'          => new sfValidatorPass(array('required' => false)),
      'codepostal'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'tel'              => new sfValidatorPass(array('required' => false)),
      'telportable'      => new sfValidatorPass(array('required' => false)),
      'possesionconsole' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('client_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Client';
  }

  public function getFields()
  {
    return array(
      'id_client'        => 'Number',
      'nom'              => 'Text',
      'prenom'           => 'Text',
      'mail'             => 'Text',
      'login'            => 'Text',
      'motdepasse'       => 'Text',
      'adresse'          => 'Text',
      'codepostal'       => 'Number',
      'tel'              => 'Text',
      'telportable'      => 'Text',
      'possesionconsole' => 'Text',
    );
  }
}
